
import {Redirect } from 'umi'
import { useIsLogin } from '@/Utils/hook/index';
import {message} from 'antd'
export default (props:any) =>{
    const isLogin = useIsLogin();
    if(isLogin){
        return (<div>{props.children}</div>)
    } else {
        message.warning('请先登录')
        return <Redirect to="/login"/>
    }
}